
package org.finegold.core.delivery.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Oss枚举类
 *
 * @author QinXueFeng
 */
@Getter
@AllArgsConstructor
public enum DeliveryEnum {

	/**
	 * 顺丰
	 */
	SF("sf", 1),
	JD("jd", 2),

	;

	/**
	 * 名称
	 */
	final String name;
	/**
	 * 类型
	 */
	final int category;

	/**
	 * 匹配枚举值
	 *
	 * @param name 名称
	 * @return OssEnum
	 */
	public static DeliveryEnum of(String name) {
		if (name == null) {
			return null;
		}
		DeliveryEnum[] values = DeliveryEnum.values();
		for (DeliveryEnum deliveryEnum : values) {
			if (deliveryEnum.name.equals(name)) {
				return deliveryEnum;
			}
		}
		return null;
	}

}
